package com.itzhihao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@TableName(value = "glgl_order")
public class Order extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "order_id",type = IdType.ASSIGN_ID)
    private Long Id;

    @NotNull(message = "用户id不能为空")
    @TableField(value = "user_id")
    private Long userId;

    @NotNull(message = "地址id不能为空")
    @TableField(value = "address_id")
    private Long addressId;

    @NotNull(message = "产品id不能为空")
    @TableField(value = "product_id")
    private Long productId;

    @NotNull(message = "商店id不能为空")
    @TableField(value = "store_id")
    private Long storeId;

    private Integer status;

    private Integer num;

    @Max(value = 200,message = "长度不得超过200")
    private String assess;
    @TableField(value = "assess_level")
    private Integer assessLevel;

    private Double price;

    @TableField(value = "pay_type")
    private Integer payType;

    @TableField(value = "is_deleted")
    private Integer isDeleted;

    @TableField(value = "complete_time")
    private Date completeTime;
}
